#ifndef MODULE_H_
#define MODULE_H_
#include <config.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <err.h>
#if HAVE___ATTRIBUTE__
#define __UNUSED__ __attribute__((unused))
#else
#define __UNUSED__
#endif

#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
#  include <sys/time.h>
# else
#  include <time.h>
# endif
#endif
/*	Added optimization macroses stollen from linux kernel*/
#define likely(x)       __builtin_expect(!!(x), 1)
#define unlikely(x)     __builtin_expect(!!(x), 0)
/**
 * \typedef
 * This structure is used to store module specific variables
 */
typedef struct _Core Core;
/**
 * \typedef
 * This structure is used to store Core Config
 */
typedef struct _Core_Config Core_Config;
/**
 * \typedef
 * This structure is used to store widget specific variables
 */
typedef struct _Widget Widget;
/**
 * \typedef
 * This structure is used to store widget configuration
 */
typedef struct _Widget_Config Widget_Config;

struct _Core{
	E_Module *m;
	Core_Config *conf;
   	Evas_List *widgets;
   	E_Config_Dialog *config_dialog;
   	Ecore_Timer *timer;
   	Ecore_Event_Handler *xss;
   	Ecore_Event_Handler *dlck;
};

struct _Core_Config{
	int version;
	int poll_time;
	Evas_List *items;
	/*- Default Widget Config -*/
	const char *theme;
	int alpha;
	const char *format;
};

struct _Widget{
	E_Module *m;
	Widget_Config *conf;
	E_Gadcon_Client *gcc;
  	Evas_Object *canvas;
  	E_Menu *menu;
	E_Config_Dialog *config_dialog;
};

struct _Widget_Config{
/**
 * Widget Config ID
 */
	const char *id;
/**
 * Widget theme filename
 */
	const char *theme;
	const char *format;
/**
 * Widget transparancy
 */
	int alpha;	
};




#endif /*MODULE_H_*/
